// in NOIP

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <algorithm>
#include <iterator>
using namespace std;
int n;
void print(int v)
{
	//const int v = *it;
	static int pows = n;
	if(v == 0)
	{
		--pows;
		return;
	}
	else
	if(pows == 0)
	{
		if(v>0)
		{
			cout << "+";
		}
		cout << v;
	}else
	if(pows == n)
	{
		if(v == 0)
		{
			--pows;
			return;
		}
		else if(v != 1 && v!= -1)
		{
			cout << v;
		}
		else if(v == -1)
		{
			cout << "-";
		}
	}
	else if(v != 0)
	{
		if(v == 1)
		{
			cout << "+";
		}
		else if(v == -1)
		{
			cout << "-";
		}
		else if(v > 0)
		{
			cout << "+";cout << v;
		}
		else
		{
			cout << v;
		}
		
	}
	else
	{
		--pows;
		return;
	}
	if(pows == 1)
	{
		cout << "x";
	}
	else if(pows != 0)
	{
		cout << "x^" << pows;
	}
	--pows;
}

istream& operator>>(istream& output,deque<int>::iterator it)
{
	output >> (*it);
	return output;
}

int main()
{
	ios::sync_with_stdio(false);
	cin >> n;deque<int> mas;
	int tmp;
	for(int i = 0 ; i <= n ;++i)
	{
		cin >> tmp;
		mas.push_back(tmp);
	}
	for_each(mas.begin(),mas.end(),print);
}
